package com.elbis.access.wg.api.request.account;

import com.elbis.access.Constants;
import com.elbis.access.response.ResponseEntity;
import com.elbis.access.wg.api.request.AbstractWargamingRequestImpl;
import com.elbis.access.wg.api.request.WOTRequestEntity;
import com.elbis.access.wg.api.response.account.AccountListResponse;
import com.elbis.access.wg.api.util.JSONUtil;

public class AccountListRequestImpl extends AbstractWargamingRequestImpl {

	public AccountListRequestImpl(WOTRequestEntity requestEntity) {
		protocol = Constants.DEFAULT_PROTOCOL;
		method = Constants.DEFAULT_METHOD;
		uri = com.elbis.access.wg.api.Constants.WOT_ACCOUNT_LIST;
		entity = requestEntity;
	}

	public AccountListRequestImpl(String protocol, String method, String uri) {
		this.protocol = protocol;
		this.method = method;
		this.uri = uri;
	}

	@Override
	public ResponseEntity updateFromResponse() {
		AccountListResponse responseImpl = JSONUtil.fromJson(
				response.getResponseData(), AccountListResponse.class);
		return responseImpl;
	}
}
